<?php
return array(
	'attributeLabels' => array(
		'web_id' => '所属网站',
		'worker_id' => '经销商'
	),
	
	'rules' => array(
		array('web_id,worker_id', 'required'),
	),	

	'relations' => array(
		'web' => array(ActiveRecord::BELONGS_TO, 'Website', 'web_id'),
		'profile' => array(ActiveRecord::HAS_ONE,'WebNewsProfile','id'),
		'worker' => array(CActiveRecord::BELONGS_TO, 'WorkerAccount', 'worker_id')
	),
	
	'behaviors' => array(
		'userScope' => array(
			'class' => 'coms.behaviors.userScopes.DefaultScope',
			'relatedFields' => array(
				'worker_id',
			),
			'autoRun' => false,
		),
		'autoUid' => array(
			'class' => 'application.components.behaviors.AutoUidBehavior',
		),
		'uidResolver' => array(
			'class' => 'coms.behaviors.AutoIdResolve',
			'uid' => 'worker_id'
		),
		'webidResolver' => array(
			'class' => 'coms.behaviors.mall.AutoWebIdResolve',
		),		
	),	
	
	'tableName' => 'web_news',
	
	'_import' => array(
		array('*', 'models.News//*'),
	),
);